import { request } from "@/utils";

export function getChannelAPI() {
    return request({
        url: '/channels',
        method: 'GET'
    })
}

export function addArticle(forms) {
    return request({
        url: '/mp/articles?draft=false',
        method: 'POST',
        data: forms
    })
}

export function editArticle(id, data) {
    return request({
        url: `/mp/articles/${id}?draft=false`,
        method: 'PUT',
        data: data
    })
}

export function getArticle(params) {
    return request({
        url: '/mp/articles',
        method: 'GET',
        params: params
    })
}

export function deleteArticle(id) {
    return request({
        url: `/mp/articles/${id}`,
        method: 'DELETE'
    })
}

export function getArticleDetailAPI(id) {
    return request({
        url: `/mp/articles/${id}`,
        method: 'GET'
    })
}